package com.xinghen.ace.common.model;

import com.google.common.collect.Lists;
import lombok.Data;

import java.util.List;

/**
 * @author xinghen
 * @ClassName: TreeNode
 * @Package: com.xinghen.ace.common.model
 * @Description 树节点
 * @create 2018-05-03 17:48
 */
@Data
public class TreeNode {

    protected int id;

    protected int parentId;

    List<TreeNode> children = Lists.newArrayList();

    /**
     * 添加子节点
     *
     * @param node
     */
    public void add(TreeNode node) {
        children.add(node);
    }

}
